﻿using System;
using System.Collections.Generic;
using System.Web;

namespace IntelligentCMS
{
    /// <summary>
    /// Page for custom designs, etc. There is a default page that the CMS uses, and then there are overridable templates base off of this page.
    /// </summary>
    public class CMSPage : System.Web.UI.Page
    {

        public CMSPage(string name)
        {
            this.name = name;
            Load();
        }


        private string name = string.Empty;
        private List<iCMSControl> controls = new List<iCMSControl>();

        /// <summary>
        /// Generates the page, replacing placeholders with actual controls.
        /// </summary>
        private void Load()
        {
            /*
            CMSDbDataLayer newDataLayer = new CMSDbDataLayer(string.Empty, CMSDbDataHelper.Microsoft);
            newDataLayer.AddQuery("SELECT [ControlID] FROM CMS_PagesControls WHERE [PageID] = '" + name + "' ORDER BY RANK ASC");
            newDataLayer.NonQuery = true;
            newDataLayer.Execute();


            for (int i = 0; i < newDataLayer.Data.Rows.Count; i++)
            {
                // todo: finalize control implementation
                //newDataLayer.Data.Rows[i].ItemArray[0].ToString();
            }
            */

        }
        
    }


    
}
